package br.com.covosys.dao;

import java.io.Serializable;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import br.com.covosys.util.BasicUtils;

public abstract class PropertiesReader implements Serializable {

	private static final long serialVersionUID = 1L;

	private Properties properties;
	
	private Logger logger = LoggerFactory.getLogger(PropertiesReader.class);
	
	public PropertiesReader(String path) {
		try {
			properties = BasicUtils.getProperties(path);
		} catch (Exception e) {
			logger.debug("Properties nao carrego: " + path, e);
		}
	}
	
	protected String concatKeys(String...keys) {
		StringBuilder query = new StringBuilder();
		for (String key : keys) {
			query.append(properties.getProperty(key));
		}		
		return query.toString();
	}
	
	protected String getKey(String key) {
		return properties.getProperty(key);
	}
}